﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DtCms.Common;

namespace DtCms.Web
{
    public partial class content : DtCms.Web.UI.BasePage
    {
        public int kindId = (int)Channel.Contents;
        public string page;
        public DtCms.Model.Contents model = new DtCms.Model.Contents();
        protected void Page_Load(object sender, EventArgs e)
        {
            page = Request.QueryString["page"];
            DtCms.BLL.Contents bll = new DtCms.BLL.Contents();
            if (!bll.Exists(page))
            {
                //得到最前的页
                page = bll.GetCallIndex();
                if (string.IsNullOrEmpty(page))
                {
                    Server.Transfer("error.aspx");
                    return;
                }
            }
            model = bll.GetModel(page);
            //切记绑定一下页面，Repeater属性的变量才会生效，如果你Repeater属性没有变量，下面这句可以忽略
            this.DataBind();
        }
    }
}
